<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>2.css中的动画</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      h2 {
        /* background-color: orange; */
        background-image: linear-gradient(45deg,red,yellow,pink,green);
      }
      @keyframes atguigu {
        from{
          transform: translateX(0);
        }
        to{
          transform: translateX(-100%);
        }
      }
      .zoukai{
        animation: atguigu 1s linear;
        animation-fill-mode: forwards;
      }
      .guolai {
        animation: atguigu 1s linear reverse;
      }
    </style>
  </head>
  <body>
    <h2>你好</h2>
  </body>
</html>